package ljl.alg.wangzheng_camp.round1.veryveryeasy;

public class _58_last_word_len {
    
    /**
     * 居然用上了昨天路飞那招
     * */
    public int lengthOfLastWord(String s) {
        s = s.trim();
        int j = s.length() - 1, i = j;
        while (i >= 0 && s.charAt(i) != ' ') i--;
        return j - i;
    }
}
